<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

  <title>e网批发管理后台</title>
  <?php include("common/conn.php"); if($_SESSION['userid']==""){echo "<script>window.location.href='login.php';</script>";} 

  ?>
  <script type="text/javascript" src="js/jquery.min.js"></script>
  <link href="css/styles.css" rel="stylesheet" type="text/css" />
  <link href="css/style2.css" rel="stylesheet" type="text/css" />
  <link href="css/css.css" rel="stylesheet" type="text/css" />
  <style>
    .move_up,.move_down{
      margin-top: 0.5em;
      padding-top: 0.5em;
      display: inline-block;
      width: 4em !important;
      height: 2em !important;
      background-color: #FF963A !important;
      border-radius: 10px;
      margin: 0 0.5em 0.5em 0.5em;
    }
  </style>
</head>

<body>
  <!--header-->
  <?php include("common/header.php");?>
  <!--header end-->
  <div id="sub_nav">

    <div id="subnav_wrap" class="container_12">
      <div id="subnav" class=" grid_12">

      </div>

    </div>


  </div>

  <!-- end sub_nav -->
  <form action="?del=ok" method="post">
    <!-- EVERYTING BELOW IS THE MAIN CONTENT -->

    <div class="container_12">

      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <th width="18%" scope="col">图片</th>
            <th width="13%" scope="col">名称</th>
            <th width="18%" scope="col">操作</th>
          </tr>
<?php 
    $rert30 = mysql_query("select * from coupon_activity_tu  order by type");
    while($sdg30=mysql_fetch_array($rert30)){
  ?>
  <tr>
    <td scope="col"><img src="<?php echo $sdg30[image]; ?>" width="50%"  height="auto"></td>
    <td scope="col"><?php echo $sdg30[type]==1?"新人优惠券图":($sdg30[type]==2?"新人商品图":($sdg30[type]==3?"平台优惠券":($sdg30[type]==4?"商家优惠券":"")));?></td>
    <td scope="col">
      <div class="youse2">
        <a href="addyouhuijuan_tu.php?id=<?php echo $sdg30[id];?>">
          <span class="colorw">编辑</span>
        </a>
      </div>
    </td>
  </tr>


  <?php }?>
</table>       

</div>

<!-- end content wrap -->

</form>
</body>
<script type="text/javascript">
$('.move_up').click(function(){
  var tr = $(this).parent().parent().parent();
  var id = tr.find('input[type="checkbox"]').val();
  var prev = tr.prev();
  var previd = prev.find('input[type="checkbox"]').val();
  var move_up = prev.find('.move_up');
  if (move_up.length >0) {
    tr.insertBefore(prev);
    var url = 'coupon_activity_tu.php?id='+id+'&changeid='+previd;
    $.get(url,function(data){

    });
  }
})
$('.move_down').click(function(){
  var tr = $(this).parent().parent().parent();
  var id = tr.find('input[type="checkbox"]').val();
  var next = tr.next();
  var nextid = next.find('input[type="checkbox"]').val();
  var move_down = next.find('.move_down');
  if (move_down.length >0) {
    tr.insertAfter(next);
    var url = 'coupon_activity_tu.php?id='+id+'&changeid='+nextid;
    $.get(url,function(data){

    });
  }
})
function add(){
  window.location.href="addcoupon_activity_tu.php";
}
</script>
</html>
